#include <stdio.h>


void he(int arr[],int n ) {
	for (int i = 0;i < n;i++) {
		printf("%d\t", arr[i]);
	}
}

void arraa(int arr[], int n) {
	int gap = 4;

	for (;gap >= 1;gap = gap - 1) {
		int key;
		for (int i = 0;i < n-gap;i++) {
			key = i + gap;
			if (arr[i] > arr[key]) {
				int mid = arr[i];
				arr[i] = arr[key];
				arr[key] = mid;
			}
		}
	}
	he(arr, n);
}

int main() {
	int arr[8] = {7,6,9,3,1,5,2,4};
	int n = sizeof(arr) / sizeof(arr[0]);
	arraa(arr, n);
	return 0;
}